﻿using QRCoder;
using Sunny.UI;
using Sunny.UI.Win32;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CentralVacuum.Froms
{
    public partial class FHelpQRCode : UIForm
    {
        public FHelpQRCode()
        {
            InitializeComponent();
        }

        private void FHelpQRCode_Load(object sender, EventArgs e)
        {
            IniFile ini = new IniFile(@"C:\FangYuanData\Setting.ini");
            string url = ini.ReadString("Help", "Url", "");

            QRCodeGenerator generator = new QRCodeGenerator();
            QRCodeData data = generator.CreateQrCode(url, QRCodeGenerator.ECCLevel.M);
            QRCode code = new QRCode(data);
            Bitmap icon = new Bitmap(Properties.Resources.charlogo);//水印图片，按需设置
            Bitmap qrImage = code.GetGraphic(8, Color.Black, Color.FromArgb(243,249,255), icon, 15, 6, true);
            pictureBox1.Image = qrImage;
        }
    }
}
